package com.gagakuai.bpm.domian.events;


import com.gagakuai.bpm.busniess.run.CallBusinessTaskCompleteRun;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class CallBusinessTaskCompleteListener implements ApplicationListener<CallBusinessTaskCompleteEvent> {

    @Resource
    private CallBusinessTaskCompleteRun callBusinessTaskCompleteRun;

    @Override
    public void onApplicationEvent(@NonNull CallBusinessTaskCompleteEvent event) {
        callBusinessTaskCompleteRun.setCallBusinessTaskCompleteEvent(event);
        callBusinessTaskCompleteRun.run();
    }
}
